package com.iwhalecloud.citybrain.flow.platform.manager.application.config;

import com.iwhalecloud.citybrain.flow.platform.manager.application.common.context.MqMessageContext;
import com.iwhalecloud.citybrain.flow.platform.manager.application.service.impl.MqProducer;

/**
 * @author: liyang
 * @date: 2022/1/11 22:12
 */
public class MqRunnerTask implements Runnable{


    private MqProducer producer;

    private MqMessageContext mqMessageContext;

    private MqRunnerTask() {
    }

    public MqRunnerTask(MqProducer producer, MqMessageContext mqMessageContext) {
        this.producer = producer;
        this.mqMessageContext = mqMessageContext;
    }

    @Override
    public void run() {
        producer.sendMessage(mqMessageContext);
    }
}
